package demo01;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Demo02Stream {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        Collections.addAll(list, "土司鸡", "土土", "土司只", "图图");

        list.stream() // 获取流
                .filter(string -> string.startsWith("土")) // 一次过滤
                .filter(string -> string.length() == 3) // 二次过滤
                .forEach(string -> System.out.println(string)); // 一次遍历
    }
}
